import request from '@/utils/request'

/**
 * 条件分页查询
 * @param {*} query 
 * @returns 
 */
export const getCommentListService = (query) => {
    return request.get('/admin/comments/page', {
        params: query
    })
}

/**
 * 修改评论状态
 * @param {*} status 
 * @param {*} id 
 * @returns 
 */
export const updateStatusService = (status, id) => {
    return request.put('/admin/comments/update/status', {
        status: status,
        commentId: id
    })
}

/**
 * 批量删除评论数据
 * @param {*} ids 
 * @returns 
 */
export const deleteBaatchService = (ids) => {
    return request.delete('/admin/comments', {
        data: ids
    })
}

/**
 * 根据评论id查询对应的评论信息
 * @param {*} id 
 * @returns 
 */
export const getByIdService = (id) => {
    return request.get(`/admin/comments/${id}`)
}

/**
 * 回复评论数据
 * @param {*} id 
 * @param {*} content 
 * @returns 
 */
export const replyCommentService = (id,content) => {
    return request.post('/admin/comments/reply', {
        id: id,
        content: content
    })
}